package com.fit.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.fit.interfaces.Car;

public class CarsBean implements Cars {

	private Map<String, Car> cars = new HashMap<String, Car>();
	
	
	public Car save(Car car){
		return this.cars.put(car.getModelName(), car);
	}
	
	
	public Collection<Car> retrieve(){
		return cars.values();
	}
	
	public Car retriveSingleCar(String modelName){
		return this.cars.get(modelName);
	}
}
